package com.jzo2o.customer.controller.agency;/**
 * @author wl
 * @version 1.0
 * @since 2025-09-17 16:54
 */

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 银行相关接口
 *
 * @author itcast
 * @create 2023/9/11 16:14
 **/
@RestController("AgencyBankController")
@RequestMapping("/agency/bank-account")
@Api(tags = "服务端 - 评价相关接口")
public class AgencyBankController {

 @Resource
  private IBankService bankService;


    /**
     * 保存或新增银行卡
     *
     * @param bankAccountUpsertReqDTO
     */
    @PostMapping
    public void save(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        // 调用服务层方法而不是自身
        bankService.saveBank(bankAccountUpsertReqDTO);
    }


    /**
     * 查询当前用户银行卡信息
     *
     * @return
     */
    @GetMapping("/currentUserBankAccount")
    public BankAccountResDTO queryCurrentUserBankAccount() {
        // 调用服务层方法而不是自身
        return bankService.queryCurrentUserBankAccount();
    }

}
